﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PPARModifyy.aspx.cs" Inherits="PPAP.Web.Part.PPARModifyy" %>

<%@ Register TagPrefix="cc1" Namespace="PPAP.WebControls" Assembly="PPAP.WebControls" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script type="text/javascript">
        function print(id) {
            url = "PPARDateEdit.aspx?id=" + id;
                        PopUpWindow(url, 430, 230, 460, 330);
//            open(url, 'newwindow', 'height=720,width=880,top=0,left=230,toolbar=yes,menubar=yes,scrollbars=yes,resizable=no,location=no,status=no');
                    }
                    function edit(id) {
                        url = "PPARRevisionEdit.aspx?id=" + id;
                        PopUpWindow(url, 430, 230, 460, 330);
                        //            open(url, 'newwindow', 'height=720,width=880,top=0,left=230,toolbar=yes,menubar=yes,scrollbars=yes,resizable=no,location=no,status=no');
                    }
    </script>
</head>
<body>
    <form id="Form1" runat="server">
    <div>
    <font size='-1' color='gray'>Current position:Admin>>Change PPAP date</font>
        <table width="800px" style="border-color: #2A48CE; border: 1px; border-style: solid;
            border-color: Gray; border-spacing: 0px;">
            <tr style="height: 32px;">
                <td style="font-weight: bold;" bgcolor="#D7D7D7" colspan="4">
                    &nbsp;
                    PPAR search
                </td>
            </tr>
            <tr>
                <td style="width: 20%; font-weight: bold; color: #2E8AC5;">
                    &nbsp;
                    Part No.:
                </td>
                <td>
                    <cc1:PartNo ID="txtPartno" Width="202px" runat="server" />
                </td>
                <td style="width: 20%; font-weight: bold; color: #2E8AC5;">
                    Part name:
                </td>
                <td>
                    <asp:TextBox autocomplete="off"   ID="txtPartName" runat="server" Width="202px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="width: 20%; font-weight: bold; color: #2E8AC5;">
                    &nbsp;
                    Color:</td>
                <td>
                <asp:TextBox autocomplete="off"   ID="txtColor" runat="server" Width="202px"></asp:TextBox>
                </td>
                <td style="width: 20%; font-weight: bold; color: #2E8AC5;">
                    Status:
                </td>
                <td>
                    <asp:DropDownList ID="ddlStatus" runat="server" Width="208px">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td style="width: 20%; font-weight: bold; color: #2E8AC5;">
                    &nbsp;
                    Revision:
                </td>
                <td>
                    <asp:TextBox autocomplete="off"   ID="tbVersion" runat="server" Width="202px"></asp:TextBox>
                </td>
                <td style="width: 20%; font-weight: bold; color: #2E8AC5;">
                    Start date:
                </td>
                <td>
                    <cc1:My97 ID="DatePicker1" runat="server" Width="90px"></cc1:My97>
                    to:<cc1:My97 ID="DatePicker2" runat="server" Width="90px"></cc1:My97>
                </td>
            </tr>
            <tr><td style="width: 20%; font-weight: bold; color: #2E8AC5;">&nbsp; Plant:
                </td><td>
                    <asp:DropDownList ID="ddlPlant" runat="server" Width="208px">
                    </asp:DropDownList>
                </td><td style="width: 20%; font-weight: bold; color: #2E8AC5;">Result:</td><td>
                    <asp:DropDownList ID="ddlResult" runat="server" Width="208px">
                        <asp:ListItem Value="">All</asp:ListItem>
                        <asp:ListItem Value="G">GREEN - approved </asp:ListItem>
                        <asp:ListItem Value="Y">YELLOW - conditionally approved</asp:ListItem>
                        <asp:ListItem Value="R">RED - refused </asp:ListItem>
                    </asp:DropDownList>
                </td></tr>
            <tr><td style="width: 20%; font-weight: bold; color: #2E8AC5;">&nbsp; Supplier name:</td><td>
                    <asp:TextBox autocomplete="off"   ID="txtSuppliername" runat="server" Width="202px"></asp:TextBox>
                </td><td style="width: 20%; font-weight: bold; color: #2E8AC5;">Supplier code:</td><td>
                    <asp:TextBox autocomplete="off"   ID="txtSuppliercode" runat="server" Width="202px"></asp:TextBox>
                </td></tr>
                <tr><td style="width: 20%; font-weight: bold; color: #2E8AC5;">&nbsp; PPAR No.:</td><td>
                    <asp:TextBox autocomplete="off"   ID="txtPPARNO" runat="server" Width="202px"></asp:TextBox>
                    </td><td></td><td></td></tr>
                <tr>
                <td align="center" colspan="4">
                    <asp:CheckBox ID="cbAll" runat="server" Text="All versions" Visible="False" />
                </td>
            </tr>
            <tr style="height:32px;">
             <td align="left" colspan="2">
                    &nbsp;</td>
                <td align="center">
                    &nbsp;
                </td>
                <td align="right" style=" padding-right:30px;" >
                    <asp:Button ID="btnSubmit" CssClass="button" runat="server" Text="Search" OnClick="btnSubmit_Click" />
                    <br />
                </td>
            </tr>
        </table>
        <br />
        <asp:DataGrid ID="dgList" HeaderStyle-BackColor="#2E8AC5" HeaderStyle-Font-Bold="true"
            HeaderStyle-Height="32px" Width="100%" OnLoad="dgLoad" 
            AutoGenerateColumns="False" AllowSorting="true" 
            runat="server" onsortcommand="dgList_SortCommand">
            <Columns>
                <asp:BoundColumn DataField="rownum" HeaderText="SN" FooterText="SN">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="bdntpartno" FooterText="Part number"  SortExpression="bdntpartno" HeaderText="Part number">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="bdntpartname" SortExpression="bdntpartname" HeaderText="Part name" FooterText="Part name">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="color" SortExpression="color" HeaderText="Color" FooterText="Color">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                 <asp:BoundColumn DataField="suppliercode" SortExpression="suppliercode" HeaderText="Supplier code" FooterText="Supplier code">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="pparno" SortExpression="pparno" HeaderText="PPAR No." FooterText="PPAR No.">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="PPARVERSION" Visible="false" HeaderText="PPAR version" FooterText="PPAR version">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="qlevel" SortExpression="qlevel" HeaderText="Q/E level" FooterText="Q/E level">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="bdntrevisionno" SortExpression="bdntrevisionno" HeaderText="Revision" FooterText="Revision">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:TemplateColumn HeaderText="Status" FooterText="Status">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# ShowAuditStatus(Eval("status").ToString(),Eval("FINALSTATUS").ToString(),Eval("isinapp").ToString()) %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn  HeaderText="Start date" SortExpression="ppardate" FooterText="Start date">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                    <ItemTemplate>
                    <asp:Label ID="lbppardate" runat="server" Text='<%#Eval("ppardate").ToString()==""?"":DateTime.Parse(Eval("ppardate").ToString()).ToString("yyyy-MM-dd")  %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn  HeaderText="End date" SortExpression="endtime" FooterText="End date">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                    <ItemTemplate>
                    <asp:Label ID="lbendtime" runat="server"  Text='<%#Eval("endtime").ToString()==""?"":DateTime.Parse(Eval("endtime").ToString()).ToString("yyyy-MM-dd")  %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateColumn>
                 <asp:TemplateColumn  HeaderText="Planned PPAR date" SortExpression="planedppardate" FooterText="Planned PPAR date">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                    <ItemTemplate>
                    <asp:Label ID="lbendtime2" runat="server"  Text='<%#Eval("planedppardate").ToString()==""?"":DateTime.Parse(Eval("planedppardate").ToString()).ToString("yyyy-MM-dd")  %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:BoundColumn DataField="FINALRESULT" HeaderText="Result" SortExpression="FINALRESULT" FooterText="Result">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="qeuser" HeaderText="BDNT Q-engineer" SortExpression="qeuser" FooterText="BDNT Q-engineer">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                 <asp:TemplateColumn HeaderText="change PPAP date" FooterText="change PPAP date">
                            <ItemStyle HorizontalAlign="Left"></ItemStyle>
                            <ItemTemplate>
                                <img id="Img1" src="~/Images/newimg/write.png" title="change PPAP date" runat="server" visible='<%# ShowEditButton(Eval("status").ToString()) %>'  onclick='<%#"javascript:print("+Eval("ID")+")" %>'  />
                            </ItemTemplate>
                        </asp:TemplateColumn>
                         <asp:TemplateColumn HeaderText="change Revision" FooterText="change Revision" Visible="false">
                            <ItemStyle HorizontalAlign="Left"></ItemStyle>
                            <ItemTemplate>
                                <img id="Img1" src="~/Images/newimg/write.png" title="change Revision" runat="server" visible='<%# ShowEditButton(Eval("status").ToString()) %>'  onclick='<%#"javascript:edit("+Eval("ID")+")" %>'  />
                            </ItemTemplate>
                        </asp:TemplateColumn>
            </Columns>
            <HeaderStyle BackColor="#E7E8E8" Font-Bold="True" Height="32px"></HeaderStyle>
        </asp:DataGrid>
        <webdiyer:AspNetPager ID="AspNetPager2" runat="server" ShowPageIndexBox="Always" CssClass="paginator"
            PageIndexBoxType="DropDownList" TextBeforePageIndexBox="goto" HorizontalAlign="Center"
            PageSize="20" EnableTheming="true" AlwaysShow="True" FirstPageText="|&lt;" LastPageText="&gt;|"
            NextPageText="&gt;" PrevPageText="&lt;" SubmitButtonText="Go" TextAfterPageIndexBox="page"
            InvalidPageIndexErrorMessage="Page index is not effective numerical！" OnPageChanged="AspNetPager2_PageChanged"
            PageIndexOutOfRangeErrorMessage="Page index beyond range" BackColor="#E7E8E8">
        </webdiyer:AspNetPager>
        
    </div>
    </form>
</body>
</html>
